﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using blackhouse.BlackApart.Data;
using blackhouse.BlackApart.Data.Caching;
using blackhouse.BlackApart.Data.Sql;

namespace blackhouse.StareKino.Web {
    internal class SKDataFactory : IDataFactory {

        #region Fields

        private IDataFactory decoratedFactory;

        #endregion

        #region Constructors

        public SKDataFactory() {
            string conn = BAFactory.GetConnectionString();
            this.decoratedFactory = new SqlDataFactory(conn);
            this.decoratedFactory = new CachedDataAccess(this.decoratedFactory, conn);
        }

        #endregion

        #region IDataFactory Members
        
        public IActionDataAccess GetActionData() {
            return this.decoratedFactory.GetActionData();
        }

        public IAdditionalServiceDataAccess GetAdditionalServicesData() {
            return this.decoratedFactory.GetAdditionalServicesData();
        }

        public IApartmentDataAccess GetApartmentData() {
            return this.decoratedFactory.GetApartmentData();
        }

        public IApartmentGroupDataAccess GetApartmentDataGroup() {
            return this.decoratedFactory.GetApartmentDataGroup();
        }

        public IApartmentLocationDataAccess GetApartmentLocationData() {
            return this.decoratedFactory.GetApartmentLocationData();
        }

        public IFurnitureDataAccess GetFurnitureData() {
            return this.decoratedFactory.GetFurnitureData();
        }

        public IMailTemplateDataAccess GetMailTemplateData() {
            return this.decoratedFactory.GetMailTemplateData();
        }

        public INewsletterDataAccess GetNewsletterDataAccess() {
            return this.decoratedFactory.GetNewsletterDataAccess();
        }

        public IOpinionsDataAccess GetOpinionsData() {
            return this.decoratedFactory.GetOpinionsData();
        }

        public IPlaceDataAccess GetPlaceData() {
            return this.decoratedFactory.GetPlaceData();
        }

        public IPricesDataAccess GetPricesData() {
            return this.decoratedFactory.GetPricesData();
        }

        public IPushMailDataAccess GetPushMailData() {
            return this.decoratedFactory.GetPushMailData();
        }

        public IReservationDataAccess GetReservationData() {
            return this.decoratedFactory.GetReservationData();
        }

        public ReservationServiceSaveTransaction GetReservationServiceSaveTransaction() {
            return new LineReservationServiceSaveTransaction(BAFactory.GetConnectionString());
        }

        #endregion

    }
}